package com.fastloan.mgt.application.enums;

/**
 * Created by gelon on 2017/11/13.
 */
public class AppEnum {

    public enum RepayStatus {

        //0未还款 1已还款 2逾期 3多还款 4还了部分 ，5逾期后完成，6客户经理强制完成 7提前还款
        NOPAY(0,"未还款"),
        ALREADY(1,"已还款"),
        OVERDUE(2,"逾期"),
        MORE_PAY(3,"多还款"),
        IN_PAY(4,"还了部分"),
        FINISHED_AFTEF_OVERDUE(5,"逾期后完成"),
        FINISHED_BY_MANAGER(6,"客户经理手动完成"),
        PREPAY(7,"提前还款")
        ;
        Integer code;
        String name;

        public void setCode(Integer code){
            this.code = code ;
        }

        public Integer getCode(){
            return this.code ;
        }

        public void setName(){
            this.name = name ;
        }

        public String getName(){
            return this.name ;
        }

        RepayStatus(Integer code , String name) {
            this.code = code ;
            this.name = name ;
        }

        public String jsonStr(Object param){
            if(param instanceof String){
                return "\"" + param + "\"";
            }else{
                return param.toString();
            }
        }


        public String toString(){
            return "{\"code\":" + jsonStr(code) + ",\"name\":" + jsonStr(name) + "}";
        }

    }


    public enum RepayType{

        EQ_P(0,"等额本金"),
        PAY_DUE(1,"到期还本付息"),
        EQ_P_I(2,"等额本息"),
        PAY_I_DUE_ALL(3,"按月付息到期还本")
        ;
        Integer code;
        String name;

        public void setCode(Integer code){
            this.code = code ;
        }

        public Integer getCode(){
            return this.code ;
        }

        public void setName(){
            this.name = name ;
        }

        public String getName(){
            return this.name ;
        }

        RepayType (Integer code , String name) {
            this.code = code ;
            this.name = name ;
        }

        public String jsonStr(Object param){
            if(param instanceof String){
                return "\"" + param + "\"";
            }else{
                return param.toString();
            }
        }


        public String toString(){
            return "{\"code\":" + jsonStr(code) + ",\"name\":" + jsonStr(name) + "}";
        }

    }

}
